<?php

namespace Admin\Model;

use Think\Model;

class ShopAccountModel extends Model {

    protected $trueTableName = 'tb_shop_account';

    public function getFind($where) {
        $result = $this->where($where)->find();
        return $result;
    }

    public function getList($where, $param) {
        $count = $this->where($where)->count();
        $Page = new \Think\Page($count, 10, $param);
        $list = $this->where($where)->limit($Page->firstRow . ',' . $Page->listRows)->order('createdt DESC')->select();
        $show = $Page->show(); // 分页显示输出
        return array('list' => $list, 'count' => $count, 'page' => $show);
    }

    public function saveData($where, $data) {
        $result = $this->where($where)->save($data);
        return $result;
    }

    public function addData($data) {
        $result = $this->add($data);
        return $result;
    }

    public function getSystemSet($where) {
        $result = $this->where($where)->field("id,shopname,contacts,telphone,opendt,closedt,address,returndt")->find();
        return $result;
    }

}
